from django.test import TestCase

# Create your tests here.

import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
cookies = {
    '_ga': 'GA1.3.1368206770.1619516577',
    '_gid': 'GA1.3.1025934554.1619516577',
    '__asc': '31588b2317912b5d3751100e406',
    '__auc': '31588b2317912b5d3751100e406',
    'AMP_TOKEN': '%24NOT_FOUND',
    'kgnotif_akuisisi': 'true',
    'uuid_c': '7814280960790401',
    'ci_session': 'a%3A5%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22102a2e8b0fa0620952d2815de111a9c7%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A12%3A%22172.16.21.22%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A114%3A%22Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F90.0.4430.85+Safari%2F537.36%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1619516891%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3B%7Dc120592072d719d484782e2e71530fc3fd49fc73',
    '_ym_uid': '16195169841017239826',
    '_ym_d': '1619516984',
    'dable_uid': '43222779.1619516984099',
    'OB-USER-TOKEN': '306e82cb-27d9-437a-b9df-7761b95d4533',
    '_ym_isad': '1',
    'ivs_video_1665977_lastPlayed': '9061,150960',
    'mako_fpc_id': '1ffcdd5f-1265-4ce3-b8cf-776134bf2a0f',
    'id5id.1st': '%20%7B%20%22created_at%22%3A%20%222021-04-27T09%3A50%3A12.304Z%22%2C%20%22id5_consent%22%3A%20true%2C%20%22original_uid%22%3A%20%22ID5-ZHMOmkiL_Jeag9FIpPACznlq2zOkX87WUW09dEmsig!%22%2C%20%22universal_uid%22%3A%20%22ID5-ZHMOCk6kQP9mjehtVgj9GyjBGDs3eBKfF83tbxHAIA!%22%2C%20%22signature%22%3A%20%22ID5_AQNnc01eETlGN41g9u61n3lkCkTFcEgO8oja11H3mK5hJPrXdVatMLTJYcaQ-2JKkhZA6nrbHZF6_Oe-Fwo-3l8%22%2C%20%22link_type%22%3A%202%2C%20%22cascade_needed%22%3A%20true%2C%20%22privacy%22%3A%20%7B%20%22jurisdiction%22%3A%20%22other%22%2C%20%22id5_consent%22%3A%20true%7D%7D',
    'id5id.1st_last': '1619517013728',
    'id5id.1st_123_nb': '1',
}

headers = {
    'Host': 'keuangan.kontan.co.id',
    'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"',
    'accept': '*/*',
    'x-requested-with': 'XMLHttpRequest',
    'sec-ch-ua-mobile': '?0',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36',
    'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'origin': 'https://keuangan.kontan.co.id',
    'sec-fetch-site': 'same-origin',
    'sec-fetch-mode': 'cors',
    'sec-fetch-dest': 'empty',
    'referer': 'https://keuangan.kontan.co.id/',
    'accept-language': 'zh-CN,zh;q=0.9',
}

data = 'offset=25&id_rubrik=terbaru&kanal_name=keuangan'

response = requests.post('https://keuangan.kontan.co.id/ajax/more_news', headers=headers, cookies=cookies, verify=False,data=data)

print(response.text)